﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Tomahawk.Resources.Serialization
{
    /// <summary>
    /// Defines the conditions that Boost Serializers had to meet
    /// </summary>
    public interface IBoostSerializer
    {
        /// <summary>
        /// The name of the type this serializer is intended for
        /// </summary>
        String TypeName { get; }

        /// <summary>
        /// Convert an object into XML
        /// </summary>
        void Serialize(object obj2Serialize, XmlWriter xmlW);

        /// <summary>
        /// Return a new object of the serializable type
        /// </summary>
        object CreateInstance();

        /// <summary>
        /// Convert an object into XML, without emiting the header
        /// </summary>
        void SerializeInner(object obj2Serialize, XmlWriter xmlW);

        /// <summary>
        /// Create an object from an XML stream
        /// </summary>
        object Deserialize(XmlReader xmlR);

        /// <summary>
        /// Create an object from an XML stream (inner part)
        /// </summary>
        void DeserializeInner(XmlReader xmlR, object targetObj);

    }


}
